import request from '@/utils/request'

export function getCates(params) {
  return request({
    url: '/api/yxStoreMerchantCategory',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: '/api/yxSystemMerchantStore',
    method: 'post',
    data
  })
}
export function code(data) {
  return request({
    url: 'api/collection/code/?uid=' + data.uid + '&path=' + data.path,
    method: 'get'

  })
}

export function examine(params) {
  return request({
    url: '/api/yxSystemMerchantStore/examine',
    method: 'get',
    params
  })
}

export function getDetailsById(data) {
  return request({
    url: '/api/yxSystemMerchantStore/getDetailsById/' + data.id,
    method: 'get'
  })
}
export function deleteStore(id) {
  return request({
    url: 'api/yxSystemMerchantStore/deleteAll?ids=' + id,
    method: 'get'
  })
}

export function del(id) {
  return request({
    url: 'api/yxSystemMerchantStore/deleteAll?ids=' + id,
    method: 'get'
  })
}

export function edit(data) {
  return request({
    url: 'api/yxSystemMerchantStore',
    method: 'put',
    data
  })
}

export function getYxUser(data) {
  return request({
    url: `api/yxUser?page=${data.page}&size=${data.page}&sort=uid,desc&userType=&classifiedQuery=${data.classifiedQuery}&nickname=${data.nickname}`,
    method: 'get',
    data
  })
}

export default { add, edit, del, getCates, examine, getYxUser }
